package cumeo89.chii.client.entry.edit;

import com.google.gwt.xml.client.Node;

import cumeo89.chii.client.entry.EntryModel;
import cumeo89.chii.client.undo.UndoableEdit;

public class InsertNodeEdit implements UndoableEdit {

	private Node parent, before, node;
	private EntryModel model;

	public InsertNodeEdit(EntryModel model, Node parent, Node node,
			Node before) {
		this.parent = parent;
		this.before = before;
		this.node = node;
		this.model = model;
	}

	public void redo() {
		model.insertBefore(parent, node, before);
	}

	public void undo() {
		model.remove(node);
	}

}
